package src.com.qf.service.impl;

import src.com.qf.dao.GoodTypeDao;
import src.com.qf.dao.impl.GoodTypeDaoImpl;
import src.com.qf.entity.GoodType;
import src.com.qf.service.GoodTypeService;
import src.com.qf.utils.JdbcUtil;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class GoodTypeServiceImpl implements GoodTypeService {
     GoodTypeDao dao = new GoodTypeDaoImpl();
    @Override
    public List<GoodType> goodTypeAjax() {
        List<GoodType> list = new ArrayList<>();

        try {
            JdbcUtil.begin();
            list = dao.selectGoodType();
            JdbcUtil.commit();
        } catch (SQLException e) {
            JdbcUtil.rollback();
            e.printStackTrace();
        }
        return list;
    }
}
